Skip to content

web: ship the editors and .odm tools behind real routes - #1183

Merged
Mearman merged 2 commits into
mainfrom
fix/1096-web-tools-v2
Sep 10, 2026
Merged

web: ship the editors and .odm tools behind real routes#1183
Mearman merged 2 commits into
mainfrom
fix/1096-web-tools-v2

Conversation

@Mearman

@Mearman Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member

Replaces #1182, closed unmerged with its branch reset before merge -- same two commits (plus the e2e spec fix asserting the real-tools contract), rebased onto current main. Nothing equivalent landed: editors.tsx is absent from main and #1096 remains open.

Closes #1096. Package/JSON and .odb had already landed; this ships the two remaining stubs: .odm (odm.render rpc over odmToPdf with a caller-supplied chapter map, unresolved chapters rendered as the route's core UX) and Editors (worker-held live-view sessions -- open/setParagraphText/addParagraph/removeParagraph/save -- over documents.js's docx/odt/doc/markdown editors, one UI for all four formats, save through each format's own writer). The navigation e2e spec now asserts both tools navigate to their real routes; full vite build with PWA precache green.

The last two nav stubs become tools. .odm rendering resolves the
master's external chapter files from a second file picker: odmToPdf
runs in the worker over the picked map, and OdmUnresolvedSectionError
crosses the rpc boundary as data -- the named list of still-missing
chapters IS the tool's UX, not an error to hide. The editors tool
drives documents.js's live-view editors through worker-held sessions:
open holds the editor and answers a paragraph snapshot, each mutation
edits the live document in place (set-text is position-preserving --
first run takes the whole text, remaining runs leave) and answers a
fresh snapshot, and save re-serialises through the format's own writer.
The v1 surface is the paragraph operations every paragraph-family
editor exposes identically, so one UI drives docx, odt, doc, and
markdown; deeper per-run styling stays out until it has the same
genuine cross-format surface.
…al routes

The navigation spec still pinned the #1096 stub contract (data-disabled,
URL unchanged on click) for the two tools that now ship real routes --
they join the real-tools table with their routes' own headings.
@Mearman
Mearman marked this pull request as ready for review September 10, 2026 04:48
@Mearman

Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@Mearman
Mearman enabled auto-merge (rebase) September 10, 2026 04:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-10T05:05:48.978852Z eeff9a1 Manual request

Security findings

Advisory findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit adb4bf1 into main Sep 10, 2026
22 checks passed
@Mearman
Mearman deleted the fix/1096-web-tools-v2 branch September 10, 2026 04:52
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: eeff9a1775

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment on lines +734 to +736
const pdf = odmToPdf(input.master, {
resolveSubDocument: (href) => byHref.get(href),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review

P3 Badge Security: Bound repeated ODM chapter expansion

When a user follows the new two-file flow with an attacker-supplied .odm and matching .odt, bound or deduplicate chapter expansion before calling odmToPdf. The master may repeat one href arbitrarily; this callback returns the same bytes each time, while odmToPdf decodes and parses that archive once per section and lays out every copy. A 42 KB master can encode 100,000 references, causing 100,000 decompressions and an enormous PDF that exhausts the dedicated worker/tab. Zod only checks types, and this handler supplies no count, cumulative-byte limit, or cancellation signal. This is in-scope hostile-document resource exhaustion.

SECURITY.md reference: SECURITY.md:L15-L18

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The web UI's four headline tools (Editors, .odb, .odm, Package / JSON) are permanent nav stubs

1 participant